package com.study.business.blog.service;

import com.study.business.blog.domain.Blog;
import com.study.business.blog.mapper.BlogMapper;
import com.study.business.util.ResponseFailed;
import com.study.business.util.ResponseSuccess;
import com.study.business.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author zhangyi
 */
public class BlogService {
    @Autowired
    private BlogMapper blogMapper;

    public ResponseUtil addBlog(Blog blog) {
        if (blogMapper.add(blog)) {
            return new ResponseSuccess(blog);
        }
        return new ResponseFailed();
    }
}
